using System;
using System.IO;
using System.Windows;
using System.Text;

using Qplus.beans;

namespace Qplus.Commands
{

    /**
     * 
     *
     */
    public class GetFriendCommand : AbsHeaderHttpCommand , HttpInputStreamProcessor{

	    const string COMMAND = "GetFriend";
	    UserInfo friend;
	    /**
	     * @param uid
	     * @param UKEY
	     */
	    public GetFriendCommand(String uid, String UKEY, UserInfo friend)
                        : base(COMMAND, uid, UKEY)
        {
		    this.friend = friend;
	    }
	
	    /**
	     * @param uid
	     * @param UKEY
	     */
	    public GetFriendCommand(long uid, byte[] UKEY, UserInfo friend)
               : base(COMMAND, Convert.ToString(uid)/*uid.GetType().ToString(),*/,  Encoding.UTF8.GetString(UKEY, 0, 32))
        {
		    this.friend = friend;
	    }
	
	    public void set(long friendID){
		    setFriendID(friendID);
	    }
	
	    private void setFriendID(long friendID){
		    addParams("FriendID", friendID);
	    }

	    
	    public override Boolean processInputStream(Stream responseStream) {

			    return true;
		   
	    }

	    
	    public override void onSuccess(int code) {
	    }

	    
	    public override void onFailed(int code) {
	    }
	
	    public HttpTask execute(String url) {
		    return base.execute(url, this);
	    }
	
	    public void onFriendInf(UserInfo info){
		
	    }
    }

}